<%--
  Created by IntelliJ IDEA.
  User: 铃
  Date: 2024/10/9
  Time: 10:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div align="center" style="margin: 0 auto;">
    <br>
<form action="" method="post">
    产品代码
    <input type="text" name="id1" value="0">
    风险评级
    <select name="risk1" id="">
        <option value="null">--请选择--</option>
        <option value="R1">R1</option>
        <option value="R2">R2</option>
        <option value="R3">R3</option>
    </select>
    <input type="button" value="查询" id="chaxun">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <a href="add.jsp">新增理财信息</a>
</form>
<br><br>
    <table id="biaotou" cellspacing="0" cellpadding="0" width="700px" align="center" style="text-align: center" border="1" >
        <tr id="thead">
            <td width="10%">产品代码</td>
            <td width="15%">风险评级</td>
            <td width="15%">预期收益</td>
            <td width="20%">发售起始日</td>
            <td width="20%">发售截止日</td>
            <td width="20%">产品到期日</td>
        </tr>
    </table>

<table cellspacing="0" cellpadding="0" width="700px" align="center" style="text-align: center" border="1" id="table">


</table>
</div>
</body>

<script src="js/jquery.js"></script>
<script>
    $("#chaxun").click(function (){
        $.ajax({
            "url":"/financingproduct?opr=select",
            "dataType":"json",
            "type":"post",
            "success":function (data){
                $("#table").empty();
                for (let i = 0; i < data.length; i++) {
                    var $tr=("<tr id='neirong'><td width='10%'>"+data[i].id+"</td><td width='15%'>"+data[i].risk+"</td><td width='15%'>"+data[i].income+"</td><td width='20%'>"+data[i].saleStarting+"</td><td width='20%'>"+data[i].saleEnd+"</td><td width='20%'>"+data[i].end+"</td></tr>");
                    $("#table").append($tr);
                }
            }
        })
    })
</script>
</html>
